package com.xls.commonlibrary.util;

import android.content.Context;
import android.net.DhcpInfo;
import android.net.wifi.WifiManager;
import android.util.Log;

// ip配置方式
public class WifiUtil {
    private static final String TAG = "SysDataUtil";

    public static String getWifiSetting(Context context) {

        String type = "";
        WifiManager wifiManager = (WifiManager) context.getSystemService(Context.WIFI_SERVICE);
        DhcpInfo dhcpInfo = wifiManager.getDhcpInfo();
        if (dhcpInfo.leaseDuration == 0) {
            //静态IP配置方式
            type = "staticIp";
        } else {
            //动态IP配置方式
            type = "DHCp";
        }
        Log.d(TAG, "IP配置方式:" + type);
        return type;
    }
}
